﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="topQuestions.aspx.vb" Inherits="examquestions.topQuestions" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="page-header">
        <h2>Top 10 highest rated questions</h2>
      </div>
        <div class="table-responsive">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" Width="100%" CssClass="table table-striped table-hover table-bordered">
            <Columns>
                <asp:BoundField DataField="ratingAverage" HeaderText="Average rating" 
                    ReadOnly="True" SortExpression="ratingAverage" DataFormatString="{0:n1}"/>
                <asp:BoundField DataField="questionText" HeaderText="Question" 
                    SortExpression="questionText" HtmlEncode="False" 
                HtmlEncodeFormatString="False"/>
                <asp:TemplateField HeaderText="More info">
            <ItemTemplate>
            <a href="Details.aspx?questionID=<%# Eval("questionID")%>" class="btn btn-primary">View question <i class="fa fa-arrow-circle-o-right"></i>
            </a></ItemTemplate>
            </asp:TemplateField>
            </Columns>
        </asp:GridView>
        </div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ExamQuestionsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ExamQuestionsConnectionString.ProviderName %>" 
            SelectCommand="SELECT [questionText], [ratingAverage], [questionID] FROM [questionsInOrderOfRatings]">
        </asp:SqlDataSource>
 <br />
</asp:Content>
